<#assign base=request.contextPath />
<#assign oneLabel="ERP管理">

<#assign twoLabel="客户管理">
<#assign twoUrl=base+"/customer/list">

<#assign leafLabel="客户列表">
<!DOCTYPE html>
<html lang="en">
<head>
	<link rel="stylesheet" href="${base}/static/assets/css/chosen.css" />
	<#include "/commons/headImport.ftl">
</head>
<body>
<#include "/commons/header.ftl">
<form class="form-horizontal" name="formName">
	<div class="row">
		<div class="col-xs-12">
			<div class="form-group">
				<label class="col-sm-2 control-label no-padding-right">公司名称</label>
				<div class="col-sm-3">
					<input type="text" name="qycompanyName" value="${queryVO.qycompanyName!''}" class="col-sm-10" />
				</div>
				<label class="col-sm-2 control-label no-padding-right">姓名</label>
				<div class="col-sm-3">
					<input type="text" name="qyfullName" value="${queryVO.qyfullName!''}" class="col-sm-10" />
				</div>
			</div>
			<div class="space-4"></div>
			
			<div class="form-group">
				<label class="col-sm-2 control-label no-padding-right">状态</label>
				<div class="col-sm-3">
					<@spring.formSingleSelect "queryVO.qystatus" statusMap 'class="col-sm-8 chosen-select"'/>
				</div>
				<div class="col-sm-3orm-group center">
					<button class="btn btn-xs btn-success" type="button" id="search_id" url="${base}/customer/list">
						<i class="icon-search icon-on-right bigger-110"></i>查询
					</button>
					<button class="btn btn-xs" type="reset" id="reset_id" url="${base}/customer/list">
						<i class="icon-undo bigger-110"></i>重置
					</button>
				</div>
			</div>
			<div class="space-4"></div>
			
			<div class="table-responsive">
				<p>
					<@shiro.hasPermission name="/customer/add">
					<button class="btn btn-minier btn-success" id="to_add_id" url="${base}/customer/add">
						<i class="icon-plus bigger-110"></i>新增客户
					</button>
					</@shiro.hasPermission>
				</p>
				<table id="sample-table-1" class="table table-striped table-bordered table-hover">
					<thead>
						<tr>
							<th class="center" width="5%">#</th>
							<th width="10%">公司名称</th>
							<th width="8%">姓名</th>
							<th width="10%">公司地址</th>
							<th width="8%">联系电话</th>
							<th width="10%">状态</th>
							<th width="25%">备注</th>
							<th width="15%"></th>
						</tr>
					</thead>
					<tbody>
					<#if pr??>
						<#list pr.data as customer>									
						<tr>
							<td class="center">${customer_index+1}</td>
							<td>${customer.companyName!}</td>
							<td>${customer.fullName!}</td>
							<td>${customer.companyAddress!}</td>
							<td>${customer.tel!}</td>
							<td>${(statusMap['${customer.status!}'])!'--'}</td>
							<td>${customer.remark!}</td>
							<td>
								<div class="visible-md visible-lg hidden-sm hidden-xs btn-group">
									<@shiro.hasPermission name="/customer/get">
									<a class="btn btn-minier btn-info" href="javascript:get('${base}/customer/getStatis/${customer.id}');" title="统计">
										<i class="icon-search bigger-120"></i>统计
									</a>
									</@shiro.hasPermission>
									<@shiro.hasPermission name="/customer/edit">
									<a class="btn btn-minier btn-success" href="javascript:get('${base}/customer/edit/${customer.id}');" title="编辑">
										<i class="icon-edit bigger-120"></i>编辑
									</a>
									</@shiro.hasPermission>
									<@shiro.hasPermission name="/customer/delete">
									<a class="btn btn-minier btn-danger id-btn-dialog2" 
										data='({"url":"${base}/customer/delete/${customer.id}","form":"formName"})' 
										href="javascript:void(0);" title="删除">
										<i class="icon-trash bigger-120"></i>删除
									</a>
									</@shiro.hasPermission>
								</div>
							</td>
						</tr>
						</#list>
					</#if>
					<#if ((pr.data)?size==0)>
						<tr>
							<td colspan="99" class="center">没有查询任何数据</td>
						</tr>
					</#if>
					</tbody>
				</table>
			
			<@p.p pageParam=pr toURL="${base}/customer/list" formName="formName"/>
		</div><!-- /.table-responsive -->
	</div><!-- /col -->
</div><!-- /row -->
</form>
<#include "/commons/footer.ftl">
<script src="${base}/static/assets/js/chosen.jquery.min.js"></script>
<script>
jQuery(function($) {
	$(".chosen-select").chosen();
});
</script>
</body>
</html>
